﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;
using ModuleDALCore;

namespace DAL
{
	public class PHONGDAO:DALBase
	{
		public PHONGDAO()
		{
			this.OpenConnect();
		}
		private DataTable dt;
		private string _SpName;

		public string SpName
		{
			get { return "SPPHONG"; }
			set { _SpName = value; }
		}
		public List<PHONG> GetDSPHONG()
		{
			dt = new DataTable();

			List<PHONG> ds = new List<PHONG>();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(new PHONG(), null), ConvertClassToArray.GetValues(new PHONG(), 0));
				ds = (List<PHONG>)ConvertDatatableToList.ConvertTo<PHONG>(dt);
			}
			catch { throw new InvalidExpressionException("Msg1: Can't list NHANVIEN"); }
			return ds;
		}
	}
}
